import React from "react";
// 引入页面
import { HashRouter as Router, Switch, Route } from "react-router-dom";
// 仓库
import { Provider } from "react-redux";
import store from "./store";
// 登录拦截
import PrivateRoute from "./utils/PrivateRoute";
//基础
import BaseLayout from "./layouts/BaseLayout";
import Login from "./pages/Login";
import Register from "./pages/Register";

const App = () => {
  return (
    <Provider store={store}>
      <Router>
        <Switch>
          <Route path="/login" component={Login}></Route>
          <Route path="/register" component={Register}></Route>
          {/* 登录拦截 */}
          <PrivateRoute path="/" component={BaseLayout}></PrivateRoute>
        </Switch>
      </Router>
    </Provider>
  );
};
// 路由配置页面
export default App;
